<?php
/**
 * Created by PhpStorm.
 * User: Tsang
 * Date: 2017/9/24 16:20
 *
 */
namespace app\admin\model;
use think\Model;

class Admin extends Model
{
   public function index($where = []){
      return db('admin')->where($where)->find();
   }

   //更新
   public function update_value($where,$data){
      return db('admin')->where($where)->update($data);
   }

   //hash密码
   public function add_hash($pass){
   	return password_hash($pass,PASSWORD_BCRYPT);
   }

   //验证密码
   public function verification_hash($pass,$hash){
   	return password_verify($pass,$hash);
   }
}